package com.bosssoft.user.permission.center.serve.dao.mapper;


import com.bosssoft.user.permission.center.serve.dao.entity.RoleCompany;
import com.bosssoft.user.permission.center.serve.pojo.vo.RoleCompanyVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleCompanyMapper {

    Boolean batchDeleteRolesWithCompany(@Param("ids") List<Long> ids);


    Boolean batchAllocateCompany(@Param("roleCompanyList") List<RoleCompany> roleCompanyList);

    List<RoleCompanyVO> checkSingleRoleCompany(@Param("roleId") Long roleId);

    @Select("select id,code,name from basic_company ")
    List<RoleCompanyVO> checkMultipleRoleCompany(@Param("roleId") List<Long> roleIds);

    @Delete("DELETE FROM basic_role_company WHERE role_id = #{roleId}")
    void batchDeleteTheCompanyOfRole(@Param("roleId") Long roleId);
}
